/**
 * @version 1.8
 * @Author Djx_hmbb
 * @Date 2023/8/8 17:47
 * @注释:创建线程方法2
 * 通过实现Runnable接口创建线程
 */


class MyRunnable implements Runnable{

    @Override
    public void run() {
        System.out.println("hello thread!");
    }
}
public class ThreadDemo2 {
    public static void main(String[] args) {
        Runnable r = new MyRunnable();
        Thread t = new Thread(r);
        t.start();
    }
}
